//
//  Model3DView.h
//  iDent
//
//  Created by Marius Corega on 7/21/09.
//  Copyright 2009 Marius Corega. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "STLReader.h"

typedef struct _Vector3D
	{
		float x;
		float y;
		float z;
	}Vector3D;

typedef enum
	{
		redIndex,
		greenIndex,
		blueIndex,
		alphaIndex
	} ClearColors;


@interface Model3DView : NSOpenGLView {

	NSPoint initPoint;
	Vector3D transPoint;
	Vector3D rotAngle;
	Vector3D modelRotAngle;
	
	BOOL showXAxes;
	BOOL showYAxes;
	BOOL showZAxes;
	
	float zoomValue;
	float transparency;

	NSMutableDictionary *modelDict;
	
	int modelDL;
	NSColor *color;
	
	NSArray *trianglesArray;
	
	IBOutlet NSWindow *toolWindow;
	
	IBOutlet NSButton *showAxesBut;
	IBOutlet NSButton *transparentModelBut;
	
	IBOutlet NSSlider *xMinSlider;
	IBOutlet NSSlider *xMaxSlider;
	IBOutlet NSSlider *yMinSlider;
	IBOutlet NSSlider *yMaxSlider;
	IBOutlet NSSlider *zMinSlider;
	IBOutlet NSSlider *zMaxSlider;
	
	IBOutlet NSPopUpButton *dintePB;
	
}

@property (readwrite) BOOL showXAxes;

-(IBAction) loadModel3D:(id)sender;
-(IBAction) saveModel3D:(id)sender;

-(IBAction) saveModelDinte3D:(id)sender;
-(IBAction) resetModelDinte3D:(id)sender;

-(IBAction) setModelColor: (id) sender;
-(IBAction) showAxes:(id) sender;
-(IBAction) changeTransparency:(id) sender;
-(IBAction) changeLimit:(id) sender;
-(IBAction) showToolWindow:(id) sender;

-(IBAction) showXAxes:(id) sender;
-(IBAction) showYAxes:(id) sender;
-(IBAction) showZAxes:(id) sender;

@end
